function openDialog() {
	$('#aaa').dialog('open');
	refreshTree();
}

function save() {
	var temp = ztree1.getCheckedNodes();
	for (var i = 0; i < temp.length; i++) {
		console.info(temp[i]);
	}
	$('#aaa').dialog('close');
}
var ztree1;
var setting;
setting = {
	isSimpleData : true,
	treeNodeKey : "id",
	treeNodeParentKey : "parent",
	showLine : true,
	checkable : true,
	callback : {
		change : zTreeOnchange
	}
};
function zTreeOnchange(event, treeId, treeNode) {
	getCheckedNodesLength();
}
function refreshTree() {
	var checkType = {
		"Y" : "ps",
		"N" : "ps"
	};
	setting.checkType = checkType;
	ztree1 = $('#treeDemo').zTree(setting, simpleNodes);
	getCheckedNodesLength();
}
function getCheckedNodesLength() {
	var temp = ztree1.getCheckedNodes();
	//				for (var i = 0;i<temp.length;i++) {
	//					temp[i].checkedOld = temp[i].checked;
	//					console.info(temp[i]);
	//				}
	//				temp = ztree1.getChangeCheckedNodes();
	//				for (var i = 0;i<temp.length;i++) {
	//					temp[i].checkedOld = temp[i].checked;
	//					console.info(temp[i]);
	//				}
	console.info(temp);
}
function close() {
	$('#aaa').dialog('close');
}
